<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript" src="resources/js/feedUtils.js"></script>

<script type="text/javascript">
    var STREAMING_SERVICE = "<c:out value = "${serverName}"/>/norsemanserver/streaming/";
    var username = "<c:out value = "${userInfo.username}"/>";
    var routeId = <c:out value = "${routeId}"/>;

    $(document).ready(function(){
        initialize();
    });
    
    function insertIndividualMediaFeed(jsonObject){
        var name =  "";
        if (jsonObject.typeOfAttendant == 'ATHLETE') {
            name = jsonObject.username;
        } else if (jsonObject.typeOfAttendant == 'SUPPORT') {
            name = jsonObject.athleteUsername;
        }

        if(name == username){
            insertForLiveMediaFeed(jsonObject);
        }
    }
    
    function initialize() {
        //register live location feed comming event
        //register live media feed comming event
        liveMediaFeedCommingEvent.addHandler(insertIndividualMediaFeed);
        //register live location for new ticker
        //REGISTER for right ticker for media
        liveMediaFeedCommingEvent.addHandler(insertNewMediaTickerPost);
    }    
</script>